<div class="page-wrapper">
    <div class="header">
        <a href="javascript:history.back();" class="left"><i class="icon-back"></i>菜单</a>
        <div id="order-preview-title" class="title">设置</div>
    </div>

    <div class="setting-body">

        <div class="setting-item">
            <span>打印机：</span><input type="text" class="ip" id="ip" placeholder="请输入打印机IP地址"> <span id="ip-confirm" class="ip-confirm">确定</span>
        </div>

        <div class="setting-item">
            <span class="exit">退出</span>
        </div>
        <script>
            $('#ip-confirm').click(function () {
                var ip = $('#ip').val();
                if(ip){
                   printer.connect(ip,function(){
                       common.savePref('ip',ip);
                        common.toast('连接'+ip+'成功');
                   },function () {
                       common.toast('连接'+ip+'失败');
                   });
                }
            });
        </script>
    </div>

</div>